package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.dto.DictionaryDto;
import com.mk.admin.model.vo.InternetMedicalVo;
import com.mk.admin.service.TaskGetAccessTokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/internetMedical")
@Api(tags = "互联网医疗服务监管平台")
public class InternetMedicalController {
    @Autowired
    private TaskGetAccessTokenService taskGetAccessTokenService;

    @PostMapping("/fresh")
    @ApiOperation("先刷新token")
    public ResultDto fresh(InternetMedicalVo vo) {
        DictionaryDto dto = new DictionaryDto();
        dto.setRemark("{\"host\":\"https://202.61.88.184:19200/\",\"url\":\"https://202.61.88.184:19200/wjw/third/oauth/getAccessToken\",\"clientId\":\"4907ae5551fa42a9b4a33180aefd3f65\",\"appsecret\":\"45e8414e5c454b20b329f2bdc5d4efc6\"}");
        return taskGetAccessTokenService.fresh(dto);
    }

    @PostMapping("/all")
    @ApiOperation("三个接口同时进行")
    public ResultDto all(InternetMedicalVo vo) {
        return taskGetAccessTokenService.all(vo);
    }

    @PostMapping("/uploadConsult")
    @ApiOperation(value = "网络咨询服务", notes = "默认选择头天的数据")
    public ResultDto counselling(InternetMedicalVo vo) {
        return taskGetAccessTokenService.counselling(vo);
    }

    @PostMapping("/uploadFurtherConsult")
    @ApiOperation(value = "网络复诊服务", notes = "默认选择头天的数据")
    public ResultDto returnVisit(InternetMedicalVo vo) {
        return taskGetAccessTokenService.returnVisit(vo);
    }

    @PostMapping("/uploadRecipe")
    @ApiOperation(value = "电子处方服务", notes = "默认选择头天的数据")
    public ResultDto prescription(InternetMedicalVo vo) {
        return taskGetAccessTokenService.prescription(vo);
    }
}
